<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn">
    <head>
        <title>文章列表</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/style/layout.css"/> 
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/style/content.css"/>
        <script src="__PUBLIC__/zebra_dialog/zebra_dialog.js"></script>
        <link rel='stylesheet' type='text/css' href='__PUBLIC__/zebra_dialog/css/zebra_dialog.css'/>
        <script>
            $(function(){
                $("#checkall").click(function(){
                    var checked=$(this).prop('checked');
                    $("input[name='ids[]']").prop('checked',checked);
                })
                $("#multidel").click(function(){
                    $("#form1").attr("action","<?php echo U('delete');?>")
                    var ids=$("#form1 input[name='ids[]']:checked").val();
                    if(!ids){
                        $.Zebra_Dialog('请选择你要删除的文章');
                        return false;
                    }
                    $.Zebra_Dialog('你确定要删除这些文档吗？',{
                        'type':'question',
                        'title':'删除确认',
                        'buttons':[
                            {caption: '取消', callback: function() {return true;}},
                            {caption: '是的', callback: function() {$("#form1").submit();return true;}}  
                        ]
                    })
                })
            })
        </script>
    </head>
    <body>
        <div class="cbox col9 f_l">
            <div class="header"><h3>文档管理</h3></div>
            <div class="content">
                <div class="innerbox">
                    <form method="post" id='form1'>
                    <table class="tt">
                        <tr>
                            <th width='30px'><input type='checkbox' id='checkall'/></th>
                            <th width='60px'>id</th>
                            <th>标题</th>
                            <th width='150px'>模型</th>
                            <th width='150px'>分类</th>
                            <th width='200px'>操作</th>
                        </tr>
                        <?php if(is_array($arclist)): $i = 0; $__LIST__ = $arclist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$eachlist): $mod = ($i % 2 );++$i;?><tr>
                            <td><input type='checkbox' name='ids[]' value='<?php echo ($eachlist["id"]); ?>'/></td>
                            <td><?php echo ($eachlist["id"]); ?></td>
                            <td>『<a href='<?php echo U('edit?id='.$eachlist['id']);?>'><?php echo ($eachlist["title"]); ?></a>』</td>
                             <td><?php echo ($eachlist["channelname"]); ?></td>
                            <td><?php echo ($eachlist["typename"]); ?></td>
                            <td><a href='<?php echo U('edit?id='.$eachlist['id']);?>'>编辑</a>  <a href='<?php echo U('delete?id='.$eachlist['id']);?>'>删除</a></td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                    </table>
                    <br/>
                    <div class="page"><ul><?php echo ($pagestr); ?></ul></div>
                    <br/>
                    <p><input type="button" value="添加文档" onclick="window.location.href='<?php echo U('add');?>'" class='subbtn'/> <input type="button" value="批量删除" class='subbtn' id='multidel'/></p>
                    </form>
                </div>
            </div>
        </div>
    </body>
</html>